package com.cys.dm.vo;

import com.cys.dm.exceptions.DmException;

public class VoUtil {

    public static<T> CommonResponse<T> returnSuccess(String message,T data){
        return new CommonResponse<>(message,data);
    }

    public static<T> CommonResponse<T> returnFail(String errorCode,String message){
        return new CommonResponse<>(errorCode,message);
    }

    public static CommonResponse returnFail(DmException dmException){
        return new CommonResponse<>(dmException.getErrorCode(),dmException.getMessage());
    }

}
